import 'package:favor_cate/core/model/meal_model.dart';
import 'package:favor_cate/core/services/http_request.dart';

class MealRequest {
  static Future<List<MealModel>> getMealDate() async{

    final String url = "http://123.207.32.32:8001/api/meal";

    final request = await HttpRequestData.request(url);

    final mealArray = request["meal"];

    List<MealModel> meals = [];
    for(var json in mealArray) {
      meals.add(MealModel.fromJson(json));
    }

    return meals;
  }

}